// Package sysin
// @Link  https://github.com/bufanyun/hotgo
// @Copyright  Copyright (c) 2024 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License  https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.13.1
package sysin

import (
	"context"
	"hotgo/internal/model/entity"
	"hotgo/internal/model/input/form"

	"github.com/gogf/gf/v2/frame/g"
)

// StockBlockDetailUpdateFields 修改板块详情字段过滤
type StockBlockDetailUpdateFields struct {
	Code         string `json:"code"         dc:"code"`
	BlockCode    string `json:"blockCode"    dc:"block_code"`
	SubBlockName string `json:"subBlockName" dc:"子版块名字"`
	Position     string `json:"position"     dc:"板块位置，如：龙一"`
	Strength     string `json:"strength"     dc:"强度"`
	Date         string `json:"date"         dc:"日期"`
}

// StockBlockDetailInsertFields 新增板块详情字段过滤
type StockBlockDetailInsertFields struct {
	Code         string `json:"code"         dc:"code"`
	BlockCode    string `json:"blockCode"    dc:"block_code"`
	SubBlockName string `json:"subBlockName" dc:"子版块名字"`
	Position     string `json:"position"     dc:"板块位置，如：龙一"`
	Strength     string `json:"strength"     dc:"强度"`
	Date         string `json:"date"         dc:"日期"`
}

// StockBlockDetailEditInp 修改/新增板块详情
type StockBlockDetailEditInp struct {
	entity.StockBlockDetail
}

func (in *StockBlockDetailEditInp) Filter(ctx context.Context) (err error) {
	// 验证code
	if err := g.Validator().Rules("required").Data(in.Code).Messages("code不能为空").Run(ctx); err != nil {
		return err.Current()
	}

	// 验证block_code
	if err := g.Validator().Rules("required").Data(in.BlockCode).Messages("block_code不能为空").Run(ctx); err != nil {
		return err.Current()
	}

	return
}

type StockBlockDetailEditModel struct{}

// StockBlockDetailDeleteInp 删除板块详情
type StockBlockDetailDeleteInp struct {
	Id interface{} `json:"id" v:"required#id不能为空" dc:"id"`
}

func (in *StockBlockDetailDeleteInp) Filter(ctx context.Context) (err error) {
	return
}

type StockBlockDetailDeleteModel struct{}

// StockBlockDetailViewInp 获取指定板块详情信息
type StockBlockDetailViewInp struct {
	Id int `json:"id" v:"required#id不能为空" dc:"id"`
}

func (in *StockBlockDetailViewInp) Filter(ctx context.Context) (err error) {
	return
}

type StockBlockDetailViewModel struct {
	entity.StockBlockDetail
}

// StockBlockDetailListInp 获取板块详情列表
type StockBlockDetailListInp struct {
	form.PageReq
	Id      int      `json:"id" dc:"id"`
	PlatIds []string `json:"platIds" dc:"platIds"`
}

func (in *StockBlockDetailListInp) Filter(ctx context.Context) (err error) {
	return
}

type StockBlockDetailListModel struct {
	entity.StockZhASpotEm
	Id           int    `json:"id"           dc:"id"`
	Code         string `json:"code"         dc:"code"`
	BlockCode    string `json:"blockCode"    dc:"block_code"`
	SubBlockName string `json:"subBlockName" dc:"子版块名字"`
	Position     string `json:"position"     dc:"板块位置，如：龙一"`
	Strength     string `json:"strength"     dc:"强度"`
	Date         string `json:"date"         dc:"日期"`
}

// StockBlockDetailExportModel 导出板块详情
type StockBlockDetailExportModel struct {
	Id           int    `json:"id"           dc:"id"`
	Code         string `json:"code"         dc:"code"`
	BlockCode    string `json:"blockCode"    dc:"block_code"`
	SubBlockName string `json:"subBlockName" dc:"子版块名字"`
	Position     string `json:"position"     dc:"板块位置，如：龙一"`
	Strength     string `json:"strength"     dc:"强度"`
	Date         string `json:"date"         dc:"日期"`
}
